#define  _CRT_SECURE_NO_WARNINGS 1

#include "CirQueue.h"

void TestCirQueue1()
{
	CirQueue CQu;
	CirQueueInit(&CQu);
	CirQueuePush(&CQu, 1);
	CirQueuePush(&CQu, 2);
	CirQueuePush(&CQu, 3);
	CirQueuePush(&CQu, 4);
	CirQueuePush(&CQu, 3);
	CirQueuePop(&CQu);
	CirQueuePop(&CQu);
	CirQueuePop(&CQu);
	CirQueuePush(&CQu, 3);
	CirQueuePush(&CQu, 3);


	while (!CirQueueEmpty(&CQu))
	{
		printf("%d ", CirQueueFront(&CQu));
		CirQueuePop(&CQu);
	}
	printf("\n");
}

void TestCirQueue2()
{
	CirQueue CQu;
	CirQueueInit(&CQu);

	CirQueuePush(&CQu, 1);
	CirQueuePush(&CQu, 2);
	CirQueuePush(&CQu, 3);
	CirQueuePush(&CQu, 4);
	CirQueuePush(&CQu, 5);

	printf("CirQueueFront: %d\n", CirQueueFront(&CQu));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQu));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQu));

	printf("\n");
	CirQueuePop(&CQu);
	CirQueuePop(&CQu);

	printf("CirQueueFront: %d\n", CirQueueFront(&CQu));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQu));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQu));
	CirQueuePush(&CQu, 6);
	CirQueuePush(&CQu, 7);

	printf("\n");

	printf("CirQueueFront: %d\n", CirQueueFront(&CQu));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQu));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQu));

	CirQueuePop(&CQu);
	CirQueuePop(&CQu);
	CirQueuePop(&CQu);
	CirQueuePop(&CQu);
	printf("CirQueueFront: %d\n", CirQueueFront(&CQu));
	printf("CirQueueBack: %d\n", CirQueueBack(&CQu));
	printf("CirQueueSize: %d\n", CirQueueSize(&CQu));
	CirQueuePop(&CQu);
	CirQueuePop(&CQu);

}

int main()
{
	//TestCirQueue1();
	//TestCirQueue2();

	return 0;
}